import React from 'react';
import LocalRouter from './home-router'
import {createBrowserHistory} from 'history'
import { pendingList } from '../web/aioxs/cancel-request';

export default function RootRouter() {
    
    const history = createBrowserHistory();
    // const location = history.location;
    // Listen for changes to the current location.
    history.listen(()=>{
        console.log("history.action:::::::::::::::::::::::::::::::::::;:",history.action);
        let pengdingArr = pendingList.values();
        let current = pengdingArr.next();
        while (!current.done) {
            current.value('cancel')
            current = pengdingArr.next()
        }
        pendingList.clear();
    })
    return(
        
        <LocalRouter />
    )
}